package {
	import com.passioneffect.display.Component;
	import com.passioneffect.scroll.ScrollHandler;	

	/**
	 * @author Passion Effect
	 */
	public class DirectionScroll extends ScrollHandler {
		static public function scroll(comp : Component) : void {
			if(comp.getSelectedItem() != null)return;
			
			var cx : Number = comp.compWidth / 2;
			var dx : Number = comp.mouseX - cx;
			
			if(dx > 0) {
				comp.scroll(dx * SuperCarouselV2(comp).rotateSpeed);
			}else {
				comp.scroll(dx * 0.5);
			}
			
			comp.invalidate();
		}
	}
}
